﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Views/Default/Site.Master" AutoEventWireup="true" %>
<%@ Import Namespace="WebDotNet.Extensions" %>
<%@ Import Namespace="WebDotNet.Samples.WdnMicroBlog.App.Entites" %>
<script runat="server">
	public List<Entry> ViewData
	{
		get
		{
			return (List<Entry>)HttpContext.Current.Items[WebFormsExtensions.ViewDataKey];
		}
	}
</script>
<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolderTitle" runat="server">
<%: "Home" %>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolderBody" runat="server">
	<% if (this.ViewData.Any()) { %>
	<ul>
	<% foreach (Entry entry in this.ViewData) { %>
		<li>
			<h2><a href="/<%: entry.Slug %>"><%: entry.Title %></a></h2>
			<div><%= entry.Content %></div>
		</li>
	<% } %>
	</ul>
	<% } %>

	<form action="" method="post">
        <div>
            <label for="title">Title</label>
            <input type="text" id="title" name="title">
            <label for="content">Content</label>
            <textarea name="content" id="content"></textarea>
            <label for="slug">URL</label>
            <input type="text" id="slug" name="slug">
        </div>
        <div>
            <input type="submit">
        </div>
    </form>
</asp:Content>
